/**
 *  Copyright 2010 Kyle O'Connor, Justin Arling, Mike Mercieca
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  any later version.
 *  
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
package edu.drexel.sd0910.ece01.aqmon.data.calc;

/**
 * Object to store the results of the calculation to place into the datastore.
 * 
 * @author Kyle O'Connor
 * 
 */
public class CalculationResult {
	
	long date;
	String nodeID;
	double PM25concentation;
	double PM10concentration;
	
	int nodeIndex;
	String labelPM25;
	String labelPM10;
	
	/**
	 * Default constructor.
	 * 
	 * @param date
	 * @param nodeID
	 * @param pm25concentation
	 * @param pm10concentration
	 */
	public CalculationResult(long date, String nodeID, double pm25concentation, double pm10concentration) {
		this.date = date;
		this.nodeID = nodeID;
		PM25concentation = pm25concentation;
		PM10concentration = pm10concentration;
		
		nodeIndex = Integer.parseInt(nodeID.substring(nodeID.indexOf('N') + 1));
		labelPM25 = nodeID + " - PM2.5";
		labelPM10 = nodeID + " - PM10";
	}

	public long getDate() {
		return date;
	}

	public void setDate(long date) {
		this.date = date;
	}

	public String getNodeID() {
		return nodeID;
	}

	public void setNodeID(String nodeID) {
		this.nodeID = nodeID;
	}

	public double getPM25concentation() {
		return PM25concentation;
	}

	public void setPM25concentation(double pm25concentation) {
		PM25concentation = pm25concentation;
	}

	public double getPM10concentration() {
		return PM10concentration;
	}

	public void setPM10concentration(double pm10concentration) {
		PM10concentration = pm10concentration;
	}

	public int getNodeIndex() {
		return nodeIndex;
	}

	public String getLabelPM25() {
		return labelPM25;
	}

	public String getLabelPM10() {
		return labelPM10;
	}

	@Override
	public String toString() {
		return "CalculationResult [PM10concentration=" + PM10concentration + ", PM25concentation=" + PM25concentation
				+ ", date=" + date + ", nodeID=" + nodeID + "]";
	}

}
